<template>
  <div class="home">
    <!-- 轮播图 -->
    <div class="lunbo">
        <el-carousel :indicator-position="indicatorPosition">
          <el-carousel-item v-for="item,i in lunbo" :key="i">
            <!-- {{ item }} -->
            <a :href="item.link_url"><img :src="item.cover" alt=""></a>
          </el-carousel-item>
        </el-carousel>
    </div>

    <!-- 热门航拍点 -->
    <div class="hot">
      <div class="hot-top">
        <h1>热门航拍点</h1>
       <a href="">热门航拍点集锦</a>
      </div>
      <div class="tu">
         <div class="one" v-for="item,i in remen" key="i">
            <div class="tu-one" >
              <!-- {{ item.image }} -->
              <img :src="item.image? item.image.large:''" alt="" >
            </div>
          {{ item.name }}
         </div>
      </div>
      
    </div>
    <!-- 精选标题 -->
     <div class="jingx">
        <h3>精选</h3>
     </div>
  </div>

  <!-- 精选类 -->
  <div class="home-selected">
    <div class="selected">
  
        <!-- 自然 -->
        <zirran></zirran>
        <!-- 城市 -->
        <chengshi></chengshi>
        <!-- 运动 -->
        <yundong></yundong>
        <!-- 人物 -->
        <renwu></renwu>
        <!-- 热门摄影 -->
        <sheying></sheying>
        <!-- 热门标签 -->
        <remens></remens>

    </div>
  </div>
</template>

<script setup>

import zirran from '../components/Home/ziran'
import chengshi from '../components/Home/chengshi'
import yundong from '../components/Home/yundong'
import renwu from '../components/Home/renwu'
import sheying from '../components/Home/sheying'
import remens from '../components/Home/remen'
import { ref, reactive } from 'vue'
import axios from 'axios'
const lunbo = reactive([])
const remen = reactive([])
// 轮播图
name()
function name() {
  axios.get('mySky/api/v2/page-contents/skypixel_root_banner_top/banners?lang=zh-Hans&platform=web&device=desktop')
    .then(res => {
      console.log(res.data.data.items)
      lunbo.push(...res.data.data.items)
    })
}
// 热门航拍
name2()
function name2() {
  axios.get('mySky/api/v2/geo-tags?lang=zh-Hans&platform=web&device=desktop')
  .then(res => {
    console.log(res.data.data.items)
    remen.push(...res.data.data.items.splice(0,5))
    remen.push(...res.data.data.items.splice(9,1))
  })
}




</script>

<style scoped lang="less">
.home {
  width: 1200px;
  margin: 0 auto;

  .lunbo{
    margin-top: 30px;
    // ::v-deep  .el-carousel__button {
    //   width: 20px !important;
    //   height: 20px !important;
    //   background-color: #0075f3 !important;
    //  }
  }

  .hot{
    .hot-top{
      display: flex;
      justify-content: space-between;
      height: 60px;
      line-height: 60px;
    }
  }
  .tu{
    display: flex;
    justify-content: space-between;
    .one{
      .tu-one{
        // width: 100px;
        height: 100px;
        img{
          display: block;
          width: 180px;
          height: 120px;
          border-radius: 4px;
        }
      }
    }
  }

  .jingx{
   
    width: 1200px;
    text-align: center;
    h3{
      display: inline-block;
      padding: 20px;
      border-bottom: 2px solid #0075f3;
    }
  }
}

.home-selected{
  margin-top: 1px;
  padding-top: 40px;
  width: 100%;
  background-color: #e9e9e9;
  .selected{
    padding-bottom: 30px;
    width: 1200px;
    margin:0 auto;
    overflow: hidden;
    .two{
      .selected-top{
        margin: 20px;
         display: flex;
         justify-content: space-between;    
         .right{
          display: flex;
          .anniu{
            margin-right: 50px;
            span{
              display: inline-block;
              margin: 0 8px;
              width: 16px;
              height: 16px;
              background-color: #d3dce6;
              border-radius: 30%;
            }

          }
         }
      }

      .selected-bottom{
        width: 4800px;
        text-align: left;
        display: flex;
        justify-content: space-between;
        transition: all .5s;
        .neir{
     
          line-height: 20px;
          background-color: #fff;
        img{
          width: 285px;
          height: 190px;
        }
        .icont{
          width: 20px;
          height: 20px;
          vertical-align: bottom;

        }
        .sheb{
          margin: 10px 0;
        }
        .yonghu{
          
          padding: 3px 5px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          span{
            font-size: 14px;
            width: 120px;
            display: inline-block;
            line-height: 30px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space:nowrap;
          }
          .toux{
            width: 30px;
            height: 30px;
            border-radius: 50%;
          }
        }
      }
      } 

    }
    // 
    // 
    .two2{
      .selected-top{
        margin: 20px;
         display: flex;
         justify-content: space-between;
   
         .right{
          display: flex;
          .anniu{
            margin-right: 50px;
            span{
              display: inline-block;
              margin: 0 8px;
              width: 16px;
              height: 16px;
              background-color: #d3dce6;
              border-radius: 30%;
            }

          }
         }
      }

      .selected-bottom{
        width: 4800px;
        text-align: left;
        display: flex;
        justify-content: space-between;
        transition: all .5s;
        .neir{
     
          line-height: 20px;
          background-color: #fff;
        img{
          width: 285px;
          height: 190px;
        }
        .icont{
          width: 20px;
          height: 20px;
          vertical-align: bottom;

        }
        .sheb{
          margin: 10px 0;
        }
        .yonghu{
          
          padding: 3px 5px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          span{
            font-size: 14px;
            width: 120px;
            display: inline-block;
            line-height: 30px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space:nowrap;
          }
          .toux{
            width: 30px;
            height: 30px;
            border-radius: 50%;
          }
        }
      }
      } 

    }
  }
}

.donghuyid1{
 background-color: #0075f3!important;
 transform: translateX(0) !important;
}
.donghuyid2{
 background-color: #0075f3!important;
 transform: translateX(1200px) !important;
}
.donghuyid3{
 background-color: #0075f3!important;
 transform: translateX(2400px) !important;
}
.donghuyid4{
 background-color: #0075f3!important;
 transform: translateX(3600px) !important;
}
.active{
background-color: #0075f3 !important;
}

// 轮播图
.el-carousel__item img {
  display: flex;
  // color: #475669;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
  width: 100%;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}


</style>